<?php
/*
# ------------------------------------------------------------------------
# JA Ores template for Joomla 1.5.x
# ------------------------------------------------------------------------
# Copyright (C) 2004-2010 JoomlArt.com. All Rights Reserved.
# @license - PHP files are GNU/GPL V2. CSS / JS are Copyrighted Commercial,
# bound by Proprietary License of JoomlArt. For details on licensing, 
# Please Read Terms of Use at http://www.joomlart.com/terms_of_use.html.
# Author: JoomlArt.com
# Websites:  http://www.joomlart.com -  http://www.joomlancers.com
# Redistribution, Modification or Re-licensing of this file in part of full, 
# is bound by the License applied. 
# ------------------------------------------------------------------------
*/

defined('_JEXEC') or die('Restricted access');
$cparams = JComponentHelper::getParams ('com_media');

// Get layout extra setting from template parameter
$content 		= file_get_contents( JPATH_THEMES.DS."ja_ores".DS.'params.ini');
$params 		= new JParameter($content);
$blog_theme 	= $params->get('default_page_layouts', "");

if($blog_theme != ""){
	$blog_theme = str_replace(" ", "", $blog_theme);
	$blog_theme = explode("\n", $blog_theme);
	if( is_array($blog_theme) )
		foreach ($blog_theme as $blt){
			$blt = str_replace(" ", "", $blt);
			$blt = trim($blt);
			if( strpos($blt, JRequest::getVar("Itemid")."=") !== false ){
				$blog_theme = str_replace(JRequest::getVar("Itemid")."=", "", $blt);
				break;
			} else $blog_theme = "";
		}
	else $blog_theme = "";
}else 
	$blog_theme = "default";

$blog_tmpl = dirname(__FILE__).DS.'blog_'.$blog_theme.'.php';

if (!is_file ($blog_tmpl)) 
	$blog_tmpl = dirname(__FILE__).DS.'blog_default.php';

include ($blog_tmpl);
?>